﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//using Explore;

namespace DoAn1
{
    public partial class DriverInfo : Form
    {
        public DriverInfo()
        {
            InitializeComponent();
        }


        public static string path;

        private void DriverInfo_Load(object sender, EventArgs e)
        {
            DriveInfo[] allDrives = DriveInfo.GetDrives();
            foreach (DriveInfo Driver in allDrives)
            {
                if (Driver.IsReady)
                {
                    if (path == Driver.Name)
                    {
                        lbl_label.Text = Driver.VolumeLabel;
                        lbl_name.Text = Driver.Name;
                        lbl_system.Text = Driver.DriveFormat;
                        lbl_total.Text = (Driver.TotalSize / 1024 / 1024 / 1024).ToString() + "GB";
                        lbl_free.Text = ((Driver.TotalSize - Driver.AvailableFreeSpace) / 1024 / 1024 / 1014).ToString() + "GB";
                        lbl_available.Text = (Driver.AvailableFreeSpace / 1024 / 1024 / 1024).ToString() + "GB";
                    }
                }
            }

        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
